/**
 *
 */
package st.yushao.restaurant.action.admin;

import java.util.List;

import st.yushao.restaurant.dao.FoodDaoService;
import st.yushao.restaurant.dao.FoodTypeDaoService;
import st.yushao.restaurant.fw.AbstractBaseAction;
import st.yushao.restaurant.vo.FoodTypeVO;

/**
 * @author acer
 *
 */
public class GetMntFoodInfoLst extends AbstractBaseAction {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = -7047513493752737232L;

    /**
     * foodTypes
     */
    private List<FoodTypeVO> foodTypes;

    /**
     * hibernate service of foodtype
     */
    private FoodTypeDaoService ftds;

    /**
     * hibernate service of foodinfo
     */
    private FoodDaoService fds;

    /* (non-Javadoc)
     * @see st.yushao.restaurant.fw.AbstractBaseAction#doExecute()
     */
    @Override
    public String doExecute() {

        // get foodlst
        foodTypes = ftds.getFoodTypeListByRest(getRestId());
        for (FoodTypeVO ft : foodTypes) {
            ft.setFoodInfos(fds.getFoodListByType(ft.getId()));
        }
        return SUCCESS;
    }

    /**
     * @param ftds the ftds to set
     */
    public void setFtds(FoodTypeDaoService ftds) {
        this.ftds = ftds;
    }
    /**
     * @param fds the fds to set
     */
    public void setFds(FoodDaoService fds) {
        this.fds = fds;
    }

    /**
     * @return the foodTypes
     */
    public List<FoodTypeVO> getFoodTypes() {
        return foodTypes;
    }

    /**
     * @param foodTypes the foodTypes to set
     */
    public void setFoodTypes(List<FoodTypeVO> foodTypes) {
        this.foodTypes = foodTypes;
    }

}
